Skip to content

feat(tui): right arrow accepts the typeahead suggestion at end of input#157

Merged
BunsDev merged 2 commits into
mainfrom
feat/right-arrow-typeahead
Jul 14, 2026
Merged

feat(tui): right arrow accepts the typeahead suggestion at end of input#157
BunsDev merged 2 commits into
mainfrom
feat/right-arrow-typeahead

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Right arrow at the end of the input accepts the current typeahead suggestion (fish-style); Tab acceptance now also works while a turn is streaming.

Context

  • Related issue/user request: recovered from local work on main.
  • Scope: a configurable right -> moveRight Chat-context default in the keybinding system, the app-side handler (accept at end-of-input, move cursor otherwise), and relaxing Tab acceptance to work mid-stream (Enter then queues the completed command).
  • Non-goals: provider alias fixes (fix(tui): canonicalize the openai-codex provider alias so /model never opens empty #156) and Claude CLI image forwarding (separate PRs from the same recovered work).

Changes

  • crates/core/src/keybindings.rs: ("right", "moveRight", KeyContext::Chat) default binding + doc line + resolver test. No hardcoded key checks; flows through the configurable keybinding system.
  • crates/tui/src/app.rs: moveRight action arm (accept suggestion at end of input, otherwise move cursor); indent/Tab arm accepts suggestions even while streaming; three behavior tests (accept at end, move mid-text, Tab-while-streaming).

Validation

  • git diff --check — clean
  • cargo fmt --all--check clean
  • cargo check --workspace — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace — not run in full; see targeted
  • Targeted/manual checks: cargo test --package claurst-tui -- typeahead (6 passed), cargo test --package claurst-core keybindings (23 passed, incl. test_right_resolves_to_move_right_in_chat)
  • Not run: full workspace suite — CI runs it; the change surface is covered by the targeted tests above.

PR Readiness

  • Diff is limited to the intended files.
  • Generated files were not edited by hand.
  • User-facing docs/help were updated or are not needed (keybindings doc comment updated in-source).
  • No secrets, credentials, local paths, or unrelated logs are included.
  • Remaining risks or follow-up work are listed above.

Fish-style acceptance: a configurable 'right' -> moveRight binding in the
Chat context routes through the keybinding system; the handler accepts the
current suggestion when the cursor sits at the end of the input and moves
the cursor otherwise. Tab acceptance now also works while a turn is
streaming, so the popup stays interactive and Enter queues the completed
command.
Copilot AI review requested due to automatic review settings July 14, 2026 09:37
@BunsDev BunsDev added crate:core Core crate (src-rust/crates/core) crate:tui Terminal UI crate (src-rust/crates/tui) enhancement New feature or request labels Jul 14, 2026
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 14, 2026 10:09am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the TUI chat input UX so the Right Arrow key accepts the current typeahead suggestion when the cursor is at the end of the input (fish-style), and adjusts Tab suggestion acceptance to remain available while a turn is streaming. It also wires the Right Arrow behavior through the configurable keybinding system (no hardcoded key checks) and adds targeted tests for the new behaviors.

Changes:

  • Add a default Chat-context keybinding mapping rightmoveRight and a resolver test in claurst-core.
  • Implement moveRight in the TUI app: accept suggestion at end-of-input, otherwise move cursor.
  • Relax the indent/Tab action to accept suggestions even while streaming, and add behavior tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src-rust/crates/tui/src/app.rs Adds moveRight action handling, relaxes indent (Tab) acceptance while streaming, and adds tests for right-arrow/Tab suggestion acceptance behavior.
src-rust/crates/core/src/keybindings.rs Adds Chat default binding for rightmoveRight, updates in-source keybinding docs, and adds a resolver test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5473 to +5477
// Right arrow: accept the typeahead suggestion when the
// cursor sits at the end of the input (fish-style);
// otherwise move the cursor. Acceptance works while
// streaming so the popup stays interactive when a turn is
// in flight — Enter then queues the completed command.
Comment on lines +5667 to +5670
// Tab: accept the typeahead suggestion, or cycle agent mode
// when the prompt is empty. Acceptance is allowed while
// streaming so the popup stays interactive when a turn is
// in flight — Enter then queues the completed command.
@BunsDev
BunsDev merged commit f8e1851 into main Jul 14, 2026
4 checks passed
@BunsDev
BunsDev deleted the feat/right-arrow-typeahead branch July 14, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate:core Core crate (src-rust/crates/core) crate:tui Terminal UI crate (src-rust/crates/tui) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants